package com.ysstech.reportworld.service;

import com.ysstech.common.entity.Dicvalue;
import com.ysstech.common.entity.PageBean;
import com.ysstech.reportworld.entity.SqlScript;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 报表世界SQL脚本管理表 服务类
 * </p>
 *
 * @author lishuangliang
 * @since 2023-01-10
 */
public interface SqlScriptService extends IService<SqlScript> {

    /**
     * 查询SQL脚本列表信息
     *
     * @param sqlScript
     * @param pageBean
     * @return
     * @throws Exception
     */
    public PageBean<SqlScript> queryAllSqlScripts(SqlScript sqlScript, PageBean pageBean) throws Exception;

    /**
     * 新增脚本数据信息
     *
     * @param sqlScript
     * @throws Exception
     */
    public void addSqlScript(SqlScript sqlScript) throws Exception;


    /**
     * 修改脚本数据信息
     *
     * @param sqlScript
     * @throws Exception
     */
    public void editSqlScript(SqlScript sqlScript) throws Exception;

    /**
     * 检查SQL的规范
     *
     * @param sqlScript
     * @return
     * @throws Exception
     */
    public String checkSqlScript(SqlScript sqlScript) throws Exception;

    /**
     * 审核脚本
     *
     * @param ids
     * @return
     * @throws Exception
     */
    public String processSqlScript(String ids) throws Exception;

    /**
     * 审核退回功能
     *
     * @param ids
     * @param msg
     * @return
     */
    public void rebutSqlScript(String ids, String msg) throws Exception;

    /**
     * 获取能还原的版本号集合，前台显示
     *
     * @return
     */
    public List<Dicvalue> getReductionVersion() throws Exception;

    /**
     * 还原版本数据
     *
     * @param version 还原的版本号
     * @throws Exception
     */
    public void reductionData(String version) throws Exception;

    /**
     * 导出脚本文件
     *
     * @param response
     * @param ids
     */
    public void downSqlScriptFile(HttpServletResponse response, String ids) throws Exception;
}
